/* Copyright (c) 2004-2024 Peigen.info. All rights reserved. */

package info.peigen.hotpot.component.gateway.core;

import info.peigen.hotpot.common.core.result.ListResult;
import info.peigen.hotpot.common.core.result.SingleResult;
import info.peigen.hotpot.common.service.base.gateway.AbstractGatewayRequest;
import info.peigen.hotpot.common.service.base.gateway.GatewayFacade;
import org.noear.solon.annotation.Inject;

/**
 * <b>(AbstractGatewayBase)</b>
 *
 * @author Peigen
 * @version 1.0.0
 * @since 2021/4/8
 */
public abstract class AbstractGatewayBase implements GatewayFacade {

    @Inject
    protected AbstractGateway abstractGateway;

    /**
     * 渠道编号
     *
     * @return String
     */
    @Override
    public abstract String channelCode();

    @Override
    public void callForSingleGateway(AbstractGatewayRequest requestBase, SingleResult result) {
    }

    @Override
    public void callForBatchGateway(AbstractGatewayRequest requestBase, ListResult result) {
    }

    protected String concatDetail(String channelErrorCode, String channelErrorMessage) {
        return "渠道返回:code=" + channelErrorCode + ",msg=" + channelErrorMessage;
    }
}